#!/bin/bash
# This script needs two arguments: the newString is used to replace oldString.
# example: ./rename.sh 0 ch8

echo "Total arguments : $#"
echo "oldString = $1"
echo "newString = $2"

for i in *.csv; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.tex; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.pdf; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.aux; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.fdb_latexmk; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.fls; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.log; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.nav; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.out; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.snm; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.synctex.gz; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.toc; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
for i in *.xdv; do mv $i $(echo $i | sed "s/$1/$2/g"); done # 2019/10/28
